package camid.distribution.events;

import java.util.Observable;
import java.util.Observer;

public class EventHandler extends Observable implements Observer {

	private String handlerName;
	
	public EventHandler(String handlerName)
	{
		this.handlerName = handlerName;
	}
	
	public void registerObserver(Observer observer) {
		this.addObserver(observer);
		
	}

	public void notifyEvent(Object event) {
		this.setChanged();
		this.notifyObservers(event);
	}

	public String getHandlerName() {
		return handlerName;
	}

	@Override
	public void update(Observable source, Object event) 
	{
		this.notifyEvent(event);
	}

}
